-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!: Allow ConfigCat provider to be used in server applications #796
fix!: Allow ConfigCat provider to be used in server applications #796
Conversation
e1c6b81
to
1070842
Compare
…gCat provider to support non-browser platforms Signed-off-by: Adam Simon <adam@configcat.com>
1070842
to
ee37eda
Compare
Signed-off-by: Adam Simon <adam@configcat.com>
ee37eda
to
ce046ff
Compare
Hey @adams85 thank you this change looks good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me and thanks for the changes!
Thanks for the release, @lukas-reining. I did a quick test and found that the new version (v0.6.0) works fine.
Since our SSR SDK can handle both targets, I guess the client provider would be more or less just a duplicate of the server one (at least, in our case). I'd avoid maintaining another package if possible. BTW, NPM packages kind of support multitargeting via the |
This PR
The
conficat-js
package that the ConfigCat provider is based on is for browser applications only as it usesXMLHttpRequest
under the hood. However, the provider might be used in server applications (like it was attempted in a Node.js application here, at around 2:00:00).For multiplatform scenarios, ConfigCat provides the
conficat-js-ssr
package (that uses Axios under the hood). This provider should use that instead ofconficat-js
to provide a more extensive support for various JS platforms.This PR also fixes another serious shortcoming of the provider: currently it cannot evaluate feature flags without setting
targetingKey
in the evaluation context. Simple feature flags may not use targeting at all, so requiring atargetingKey
to evaluate them is obviously not correct.Related Issues
n/a
Notes
n/a
Follow-up Tasks
n/a
How to test
n/a